package core.ui.demo;

import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.ListView;
import javafx.scene.layout.HBox;
/**
 * @author 李瑜
 * @since JavaFX 8.0
 */
public class DemoListView
{
	public static HBox getListView()
	{
		HBox box = new HBox();
		box.setAlignment(Pos.TOP_RIGHT);
		box.setSpacing(5);
		ObservableList<Node> boxs = box.getChildren();
		
		ListView<String> list1 = new ListView<>();
		list1.getItems().addAll(new String[]{"选项1","选项2","选项3"});
		
		ListView<String> list2 = new ListView<>();
		list2.getItems().addAll(new String[]{"选项1","选项2","选项3"});
		list2.setOrientation(Orientation.HORIZONTAL);
		
		boxs.add(list1);
		boxs.add(list2);
		
		return box;
	}
}
